unit UOCR;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Menus, Db, DBTables;

type
  TFOCR = class(TForm)
    MainMenu1: TMainMenu;
    Geral: TMenuItem;
    Sair: TMenuItem;
    MLP1: TMenuItem;
    conjEntrada: TMenuItem;
    Treino576x10: TMenuItem;
    teste576x10: TMenuItem;
    Sobre: TMenuItem;
    N2: TMenuItem;
    Database1: TDatabase;
    Parmetros: TMenuItem;
    N1: TMenuItem;
    conjTeste: TMenuItem;
    N3: TMenuItem;
    treino1600x10: TMenuItem;
    teste1600x10: TMenuItem;
    procedure SairClick(Sender: TObject);
    procedure conjEntradaClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ParmetrosClick(Sender: TObject);
    procedure SobreClick(Sender: TObject);
    procedure Treino576x10Click(Sender: TObject);
    procedure conjTesteClick(Sender: TObject);
    procedure teste576x10Click(Sender: TObject);
    procedure treino1600x10Click(Sender: TObject);
    procedure teste1600x10Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    NEpocas: longint;
    Aprendizagem, Inercia: double;
    NeuroniosOcultos: byte;
    Conhecimento: string;
  end;

var
  FOCR: TFOCR;

implementation

uses UConjTrein, UParam, USobre, UOCRTrein576, UConjTeste, UOCRTeste576,
     UOCRTrein1600, UOCRTeste1600;

{$R *.DFM}

procedure TFOCR.SairClick(Sender: TObject);
begin
   Application.Terminate;
end;
//------------------------------------------------------
procedure TFOCR.conjEntradaClick(Sender: TObject);
begin
   if not Assigned(ConjTrein) then
      ConjTrein := TConjTrein.Create(self);

   ConjTrein.Show;
end;
//------------------------------------------------------
procedure TFOCR.FormCreate(Sender: TObject);
begin
   NEpocas := 10;
   Aprendizagem := 0.9;
   Inercia := 0.3;
   NeuroniosOcultos := 0;
   Conhecimento := 'Perfil.mlp';
end;
//------------------------------------------------------
procedure TFOCR.ParmetrosClick(Sender: TObject);
begin
   if not Assigned(Parametros) then
      Parametros := TParametros.Create(self);

   if Parametros.ShowModal = mrOk then;
   Parametros.Free;
   Parametros := nil;
end;
//------------------------------------------------------
procedure TFOCR.SobreClick(Sender: TObject);
begin
   if not Assigned(Sobre) then
      Sobre := TSobre.Create(self);

   if Sobre.ShowModal = mrOk then;
   Sobre.Free;
   Sobre := nil;
end;
//------------------------------------------------------
procedure TFOCR.Treino576x10Click(Sender: TObject);
begin
   if not Assigned(FOCRTrein576) then
      FOCRTrein576 := TFOCRTrein576.Create(self);

   FOCRTrein576.Show;
end;
//------------------------------------------------------
procedure TFOCR.conjTesteClick(Sender: TObject);
begin
   if not Assigned(ConjTeste) then
      ConjTeste := TConjTeste.Create(self);

   ConjTeste.Show;
end;
//------------------------------------------------------
procedure TFOCR.teste576x10Click(Sender: TObject);
begin
   if not Assigned(FOCRTeste576) then
      FOCRTeste576 := TFOCRTeste576.Create(self);

   FOCRTeste576.Show;
end;
//------------------------------------------------------
procedure TFOCR.treino1600x10Click(Sender: TObject);
begin
   if not Assigned(FOCRTrein1600) then
      FOCRTrein1600 := TFOCRTrein1600.Create(self);

   FOCRTrein1600.Show;
end;
//------------------------------------------------------
procedure TFOCR.teste1600x10Click(Sender: TObject);
begin
   if not Assigned(FOCRTeste1600) then
      FOCRTeste1600 := TFOCRTeste1600.Create(self);

   FOCRTeste1600.Show;
end;
//------------------------------------------------------
end.
